﻿namespace jinmaMesProxy.DataAccess
{
    public class ErpConfig
    {
        internal string server { get; private set; }
        internal string database { get; private set; }
        internal string uid { get; private set; }
        internal string pwd { get; private set; }
        public ErpConfig(string server, string database, string uid, string pwd)
        {
            this.server = server;
            this.database = database;
            this.uid = uid;
            this.pwd = pwd;
        }
        public static ErpConfig Default()
        {
            var server = ConfigReader.ReadSetting("Db", "Server");
            var database = ConfigReader.ReadSetting("Db", "Database");
            var uid = ConfigReader.ReadSetting("Db", "Uid");
            var pwd = ConfigReader.ReadSetting("Db", "Pwd");
            return new ErpConfig(server, database, uid, pwd);
        }
    }
}
